package cn.labbook.bluetooth.entity.alipay;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2019041163824546";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDLU61h0mD/PRRfP2V39mutrIKeGL95vVaU0kFv35ya1QI8CJU6YaVv6dj4Rb5hVXVrBQ4Urlw2fDxQEE9V2E8Qmn3b520/lSC0vzqesUr3DktUIRkxv7aFpUW2D27xyzsGuMIClhFeGVnGnYe42VRzJlmwMsP6tZKDdCDKZsmSve7OflPaaBzqNZwkMYI9tZtyXC2b8qOfn3rtOYUlALoMAj/+Qd+W507borcixIGmmLH+epgc/SfwHKq9P0ufIsjf4Htn4D9rlw5ExX4fMZd82POsvPPHFDtzOCM0io8083x7JPRq8LEolV+dElETghHcTOdoiTCRf0/uec4noYq7AgMBAAECggEAAfH7/6qWmPqJnlup6drmrtOusDqGYnDISkY0sBBQnD6bdd2TJ+rVPVvcYouwRZgetnZm6xW79h18KjvttmGKaBtCRv9Q0UHo/TGzKt+BWxm86MIkTpCJ+39YSmSdaBzMpMTRvlqXMfJGJJtPOBqEL1HXm9Lwgw6Hp1BOHAGdvhSkt+lkOEs11vhvU2Kc1sEg82JfRiPvSRYMLHQ5ZS9bb8SB9w+RdEwUkcQ2NIX3VxEs58jZBoGqJEJbzQB0EQiA+klJ5QwrLct6FH44Wzc0Rm9IPS0lVk+Bf3cBBSMpJ7BRfPdOPXBSb3lpHk6aAi6+xFUHohtfmtke6MZQKciRIQKBgQD8hs5/1l/fpbiPqVagFQjJ0KPQdo9fBbJFzlhCWHKUnOyslDXgpThtnnCInFvB5xCVrRjcPwKZbYPTYgtkywKPtc9F2BMdNsnjpUEEDSEmx45qs34TAYBz6Czj/Uf8YaeFXypnsQUF4fM0BYBGOloZkullhWgqWnOmDgPWh8Rp6wKBgQDOH6ETbgNJCMP4jAdLwcxgu7gYV+5SeYkRzXeTENdioIKzB24vLXvlyvaVHWhlgHGqa50DlQVQ45EPJTRINkqubiS7wMVImcpcCfWiuNPP/OxaPa6Kb33PUAt1DYpQVcHjzauqOk21+YdjpMAM+lQWD354CEfuCQU63RqI7//ecQKBgQCWTSpVXmQb+kgagcDEcSCU9jC6YAa/mOVdtQ5FFt3D5I7dvS1AMzad0CLMvLvEcmIlpCxa0soaRdujkgSUDlzM6nqe6Jef2L9bVj2XSrVDnpz+lyzf5RHuau9lF5ij9/+8W0MjCnKh6LVXbjrGEe8Ur6NpQHkaVFHnMQpJwu891wKBgAulf91wLuFWjHQjvVnLdnfUw38koMOqOFN4L5RwtCrPdPMWrWQfBswiHrKoObjafBGsCPAl4GoEobKgYIbgAnI+qPau2rbScbunmGh8VwN+gABNUepiiFJJbIxNmo4VemIbweJZbwCkO8Emku9oyY2BjJzNovrRKal8yr4ICYYRAoGAKHzTdYQVuT6HLNusTJ6csm7UKQQexqp6CqciSDA0zUKJRmiTUvAM16nEcH3LMlqutdwc23BgpUwTMpVC9lVivC+pgD6SoHNj4QlO+xsZjBJvQwGnJbKZtaZAMY3y5W7dLRqEVlnNbqEYtdrmQ+TebWpNkEDyY4ZwCZIqvPH/4fg=";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgvZXPZOIrC2mdR2Iz8zUtiiumCKwWxVZjn9p6YJfLGyoVdcDm9LSDnMu8Ybo16PE200cHZYtmYlKyDOEuOZv4wPK8a/E4Qfy3taqrUDqZHrXfdzeoNpj76+R374SGkdr9a9HinMtKjxQSqevwaNLceEle8jizLvipRkU3rppv/4JbrCrLvY9gFaD5LIhVb9njOawFtUX46YNsZmJPcuxE81z+dIbpRWmIPRfvUIp47Y/xPnuXhTE9nZIMIRA+jVNC785T1QPumEAZNlktOYkeF3pm0vrAC8T3aOvRwCd06ALfYcOZoKkKMiD298JO4YH+wzH8BXqGOpn9TXtzUnTdQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "https://bluetooth.zoercn.com/bluetooth/inform/asynchronization";
//    public static String notify_url = "http://192.168.1.102:8080/return/url";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "https://bluetooth.zoercn.com/bluetooth/inform/synchronization";
//    public static String return_url = "https://www.taobao.com/";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

